package org.dallasrowing.model;

public class Boat {

	private String name;
	private int seats;
	private boolean withCox;
	private int id;
	private boolean retired = false;

	public Boat(int id, String name, int seats, boolean withCox)
	{
		this.id = id;
		this.name = name;
		this.seats = seats;
		this.withCox = withCox;
	}
	
	public Boat()
	{
		
	}

	public String getName() {
		return name;
	}

	public int getSeats() {
		return seats;
	}

	public boolean isWithCox() {
		return withCox;
	}


	
	@Override
	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + id;
		result = PRIME * result + ((name == null) ? 0 : name.hashCode());
		result = PRIME * result + seats;
		result = PRIME * result + (withCox ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Boat other = (Boat) obj;
		if (id != other.id)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (seats != other.seats)
			return false;
		if (withCox != other.withCox)
			return false;
		return true;
	}

	public String toString()
	{
		return
			"Id: " + getId() + "\n" +
			"Name: " + getName() + "\n" +
			"retired: " + isRetired() + "\n" +
			"Seats: " + getSeats() + "\n" +
			"Cox: " + isWithCox() + "\n";
	}

	public int getId() {
		return id;
	}

	@SuppressWarnings( "unused" )
	private void setId(int id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setSeats(int seats) {
		this.seats = seats;
	}

	public void setWithCox(boolean withCox) {
		this.withCox = withCox;
	}

	public void setRetired(boolean retired) {
		this.retired = retired;
	}
	
	public boolean isRetired()
	{
		return this.retired;
	}
	
	
}
